﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using PSE.Updater.Common.Gateway.DataContract;
using System.Globalization;

namespace PSE.Updater.Client.UI.Converters
{
    [ValueConversion(typeof(PackageType), typeof(string))]
    public class PackageTypeConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            PackageType type = (PackageType)value;
            switch (type)
            {
                case PackageType.Hotfix:
                    return "HotFix";
                case PackageType.ServicePack:
                    return "Service Pack";
                case PackageType.RTM:
                    return "RTM";
                default:
                    return "Tipo de Pacote não Identificado";
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
